package cn.frt.paging;

import java.util.List;

import cn.frt.pojo.Shops;

public class Page<T> {
	private int pageNo=1;//当前页码
	private int pageSize=0;//页面容量
	private int totalCount=0;//总数量
	private int totalPageCount=1;//总页数
	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		if(pageNo>0){
			this.pageNo = pageNo;
		}
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		if(pageSize>0)
			this.pageSize = pageSize;
	}
	public int getTotalCount() {
		return totalCount;
	}
	//计算总数量
	public void setTotalPageCountByRs(){
		if(this.totalCount%this.pageSize==0){
			this.totalPageCount = this.totalCount/this.pageSize;
		}else if(this.totalCount%this.pageSize!=0){
			this.totalPageCount = this.totalCount/this.pageSize+1;
		}else{
			this.totalPageCount = 0;
		}
	}
	//总数量
	public void setTotalCount(int totalCount) {
		if(totalCount>0){
			this.totalCount = totalCount;
			//设置总页数
			this.setTotalPageCountByRs();
		}
	}
	public int getTotalPageCount() {
		return totalPageCount;
	}
	public void setTotalPageCount(int totalPageCount) {
		this.totalPageCount = totalPageCount;
	}
	//流程：查询新闻总数量--->setTotalCount(1000)--->拿到总页数getTotalPageCount（）

}
